﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 七天入手上位机第一个项目
{
   
    public partial class DeviceAlarm : UserControl
    {
        public DeviceAlarm()
        {
            InitializeComponent();
        }

        // 设备名称属性
        private string deviceName = "名称";
        [Description("设置或获取设备名称")]
        [Browsable(true)]
        public string DeviceName
        {
            get { return deviceName; }
            set
            {
                deviceName = value;
                this.lbl_Name.Text = value;
            }
        }

        // 设备状态属性
        private bool state = false;
        [Browsable(true)]
        [Description("设置或获取设备的状态")]
        public bool State
        {
            get { return state; }
            set
            {
                state = value;
                if (state)
                {
                    this.pic_light.Image = Properties.Resources.红灯提醒;
                }
                else
                {
                    this.pic_light.Image = Properties.Resources.绿灯提醒;
                }
            }
        }
    }


}
